/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2025-05-13     Administrator       the first version
 */
#ifndef HARDWARE_DATA_H_
#define HARDWARE_DATA_H_

#define RX_BUFFER_K230_SIZE       128
#define RX_RINGBUF_K230_SIZE      256
#define K230_UART_NAME       "uart3"  // 替换为你实际使用的串口名
#define JXB_UART_NAME        "uart6"
#define Song_UART_NAME       "uart5"
#define LCD_UART_NAME        "uart4"

#define JQ8x00_BusyCheck    0       //忙检测，0表示不做忙检测，1表做忙检测

#include "system.h"

// 状态机状态定义
enum {
    WAIT_LABEL,
    READ_LABEL,
    READ_X,
    READ_Y,
    READ_DISTANCE
} state;

// ====== 枚举定义不变 ======
typedef enum {
    AppointTrack      = 0x07,
    SetCycleCount     = 0x19,
    SetEQ             = 0x1A,
    SelectTrackNoPlay = 0x19,
    GoToDisksign      = 0x0B,
    SetVolume         = 0x13,
    SetLoopMode       = 0x18,
    SetChannel        = 0x1D,
    AppointTimeBack   = 0x22,
    AppointTimeFast   = 0x23,
} UartCommandData;

//串口初始化
int k230_uart_init(void);

rt_err_t k230_uart_rx_callback(rt_device_t dev, rt_size_t size);

void k230_data_task(void *parameter);

int JXB_init(void);

void JXB_send_byte(rt_uint8_t group_id, rt_uint16_t run_times);

//语音串口初始化
int Song_uart_init(void);

void Song_SendCode(uint8_t *data, uint8_t len);

void JQ8x00_Command_Data(UartCommandData Command, uint8_t DATA);

//屏幕串口初始化
int LCD_uart_init(void);


extern char toy_label[20];  // 保存标签
extern int toy_x;
extern int toy_y;
extern float toy_distance;







#endif /* HARDWARE_DATA_H_ */
